package com.infra.micro.oss.fallback;

import com.infra.micro.oss.api.OssHealthApi;
import com.infra.common.resp.Response;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class OssHealthApiFallback implements FallbackFactory<OssHealthApi> {
    @Override
    public OssHealthApi create(Throwable cause) {
        return new OssHealthApi() {
            @Override
            public Response<Date> heartBeat() {
                return Response.error("服务器错误，请联系相关服务负责人");
            }
        };
    }
}
